'use strict';
var count = 66;
/**
 * 初始化列表
 */
var list = document.getElementById('list');
for(var i = 0; i < count; i++) {
	var item = document.createElement('div');
	item.className = 'item';
	var title = document.createElement('p');
	title.className = 'title';
	title.innerText = "Title " + (i + 1);
	item.appendChild(title);
	var content = document.createElement('div');
	content.className = 'content';
	item.appendChild(content);
	list.appendChild(item);
}

/**
 * 计算列表里子项的高度
 **/
var indexes = [{title: 'Title 1', top: 0}];
var count = list.children.length;
for(var i = 1; i < count; i++) {
	var child = list.children[i];
	indexes.push({
		title: 'Title ' + (i + 1), 
		top: indexes[i-1].top + child.clientHeight
	});
}

var indexer = new Indexer('drawer', 'list', indexes);